<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.math.Probability</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.math.Probability";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.math.Probability.html" class="symbol">tango.math.Probability</a></h1>
  
<div class="summary">Cumulative Probability Distribution Functions</div>
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Authors:</p>Stephen L. Moshier (original C code), Don Clugston
<dl>
<dt class="decl">real <a class="symbol _function" name="normalDistribution" href="./htmlsrc/tango.math.Probability.html#L56" kind="function" beg="56" end="59">normalDistribution</a><span class="params">(real <em>a</em>)</span>; <a title="Permalink to this symbol" href="#normalDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L56">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="normalDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L62" kind="function" beg="62" end="65">normalDistributionCompl</a><span class="params">(real <em>a</em>)</span>; <a title="Permalink to this symbol" href="#normalDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L62">#</a></dt>
<dd class="ddef">
<div class="summary">Cumulative distribution function for the Normal distribution, and its complement.</div>
The normal (or Gaussian, or bell-shaped) distribution is
defined as:
<p class="bl"/>
normalDist(x) = 1/√ &pi; &#8747; exp( - t<sup>2</sup>/2) dt
    = 0.5 + 0.5 * erf(x/sqrt(2))
    = 0.5 * erfc(- x/sqrt(2))
<p class="bl"/>
Note that
normalDistribution(x) = 1 - normalDistribution(-x).
<p class="sec_header">Accuracy:</p>Within a few bits of machine resolution over the entire
range.
<p class="sec_header">References:</p><a href="http://www.netlib.org/cephes/ldoubdoc.html">http://www.netlib.org/cephes/ldoubdoc.html</a>,
G. Marsaglia, "Evaluating the Normal Distribution",
Journal of Statistical Software <b>11</b>, (July 2004).</dd>
<dt class="decl">real <a class="symbol _function" name="normalDistributionInv" href="./htmlsrc/tango.math.Probability.html#L80" kind="function" beg="80" end="83">normalDistributionInv</a><span class="params">(real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#normalDistributionInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L80">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="normalDistributionComplInv" href="./htmlsrc/tango.math.Probability.html#L86" kind="function" beg="86" end="89">normalDistributionComplInv</a><span class="params">(real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#normalDistributionComplInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L86">#</a></dt>
<dd class="ddef">
<div class="summary">Inverse of Normal distribution function</div>
Returns the argument, x, for which the area under the
 Normal probability density function (integrated from
 minus infinity to x) is equal to p.
<p class="bl"/>
 For small arguments 0 &lt; p &lt; exp(-2), the program computes
 z = sqrt( -2 log(p) );  then the approximation is
 x = z - log(z)/z  - (1/z) P(1/z) / Q(1/z) .
 For larger arguments,  x/sqrt(2 pi) = w + w^3 R(w^2)/S(w^2)) ,
 where w = p - 0.5 .</dd>
<dt class="decl">real <a class="symbol _function" name="studentsTDistribution" href="./htmlsrc/tango.math.Probability.html#L120" kind="function" beg="120" end="185">studentsTDistribution</a><span class="params">(int <em>nu</em>, real <em>t</em>)</span>; <a title="Permalink to this symbol" href="#studentsTDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L120">#</a></dt>
<dd class="ddef">
<div class="summary">Student's t cumulative distribution function</div>
Computes the integral from minus infinity to t of the Student
 t distribution with integer nu &gt; 0 degrees of freedom:
<p class="bl"/>
   &#915;( (nu+1)/2) / ( sqrt(nu &pi;) &#915;(nu/2) ) *
 <big>&#8747;<sub><small>-&infin;</small></sub><sup>t</sup></big> (1+x<sup>2</sup>/nu)<sup>-(nu+1)/2</sup> dx
<p class="bl"/>
 Can be used to test whether the means of two normally distributed populations
 are equal.
<p class="bl"/>
 It is related to the incomplete beta integral:
        1 - studentsDistribution(nu,t) = 0.5 * betaDistribution( nu/2, 1/2, z )
 where
        z = nu/(nu + t<sup>2</sup>).
<p class="bl"/>
 For t &lt; -1.6, this is the method of computation.  For higher t,
 a direct method is derived from integration by parts.
 Since the function is symmetric about t=0, the area under the
 right tail of the density is found by calling the function
 with -t instead of t.</dd>
<dt class="decl">real <a class="symbol _function" name="studentsTDistributionInv" href="./htmlsrc/tango.math.Probability.html#L197" kind="function" beg="197" end="228">studentsTDistributionInv</a><span class="params">(int <em>nu</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#studentsTDistributionInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L197">#</a></dt>
<dd class="ddef">
<div class="summary">Inverse of Student's t distribution</div>
Given probability p and degrees of freedom nu,
 finds the argument t such that the one-sided
 studentsDistribution(nu,t) is equal to p.
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>nu</em></td><td>degrees of freedom. Must be >1</td></tr>
<tr><td><em>p</em></td><td>probability. 0 < p < 1</td></tr></table></dd>
<dt class="decl">real <a class="symbol _function" name="fDistribution" href="./htmlsrc/tango.math.Probability.html#L296" kind="function" beg="296" end="307">fDistribution</a><span class="params">(int <em>df1</em>, int <em>df2</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#fDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L296">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="fDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L310" kind="function" beg="310" end="320">fDistributionCompl</a><span class="params">(int <em>df1</em>, int <em>df2</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#fDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L310">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="fDistributionComplInv" href="./htmlsrc/tango.math.Probability.html#L343" kind="function" beg="343" end="362">fDistributionComplInv</a><span class="params">(int <em>df1</em>, int <em>df2</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#fDistributionComplInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L343">#</a></dt>
<dd class="ddef">
<div class="summary">The F distribution, its complement, and inverse.</div>
The F density function (also known as Snedcor's density or the
 variance ratio density) is the density
 of x = (u1/df1)/(u2/df2), where u1 and u2 are random
 variables having &chi;<sup>2</sup> distributions with df1
 and df2 degrees of freedom, respectively.
<p class="bl"/>
 fDistribution returns the area from zero to x under the F density
 function.   The complementary function,
 fDistributionCompl, returns the area from x to &infin; under the F density function.
<p class="bl"/>
 The inverse of the complemented F distribution,
 fDistributionComplInv, finds the argument x such that the integral
 from x to infinity of the F density is equal to the given probability y.
<p class="bl"/>
 Can be used to test whether the means of multiple normally distributed
 populations, all with the same standard deviation, are equal;
 or to test that the standard deviations of two normally distributed
 populations are equal.
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>df1</em></td><td>Degrees of freedom of the first variable. Must be >= 1</td></tr>
<tr><td><em>df2</em></td><td>Degrees of freedom of the second variable. Must be >= 1</td></tr>
<tr><td><em>x</em></td><td>Must be >= 0</td></tr></table></dd>
<dt class="decl">real <a class="symbol _function" name="chiSqrDistribution" href="./htmlsrc/tango.math.Probability.html#L396" kind="function" beg="396" end="403">chiSqrDistribution</a><span class="params">(real <em>v</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#chiSqrDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L396">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="chiSqrDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L406" kind="function" beg="406" end="413">chiSqrDistributionCompl</a><span class="params">(real <em>v</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#chiSqrDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L406">#</a></dt>
<dd class="ddef">
<div class="summary">&chi;<sup>2</sup> cumulative distribution function and its complement.</div>
Returns the area under the left hand tail (from 0 to x)
 of the Chi square probability density function with
 v degrees of freedom. The complement returns the area under
 the right hand tail (from x to &infin;).
<p class="bl"/>
  chiSqrDistribution(x | v) = (<big>&#8747;<sub><small>0</small></sub><sup>x</sup></big>
          t<sup>v/2-1</sup> e<sup>-t/2</sup> dt )
             / 2<sup>v/2</sup> &#915;(v/2)
<p class="bl"/>
  chiSqrDistributionCompl(x | v) = (<big>&#8747;<sub><small>x</small></sub><sup>&infin;</sup></big>
          t<sup>v/2-1</sup> e<sup>-t/2</sup> dt )
             / 2<sup>v/2</sup> &#915;(v/2)
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>v</em></td><td>degrees of freedom. Must be positive.</td></tr>
<tr><td><em>x</em></td><td>the &chi;<sup>2</sup> variable. Must be positive.</td></tr></table></dd>
<dt class="decl">real <a class="symbol _function" name="chiSqrDistributionComplInv" href="./htmlsrc/tango.math.Probability.html#L427" kind="function" beg="427" end="435">chiSqrDistributionComplInv</a><span class="params">(real <em>v</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#chiSqrDistributionComplInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L427">#</a></dt>
<dd class="ddef">
<div class="summary">Inverse of complemented &chi;<sup>2</sup> distribution</div>
Finds the &chi;<sup>2</sup> argument x such that the integral
 from x to &infin; of the &chi;<sup>2</sup> density is equal
 to the given cumulative probability p.
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>p</em></td><td>Cumulative probability. 0<= p <=1.</td></tr>
<tr><td><em>v</em></td><td>Degrees of freedom. Must be positive.</td></tr></table></dd>
<dt class="decl">real <a class="symbol _function" name="gammaDistribution" href="./htmlsrc/tango.math.Probability.html#L455" kind="function" beg="455" end="461">gammaDistribution</a><span class="params">(real <em>a</em>, real <em>b</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#gammaDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L455">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="gammaDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L464" kind="function" beg="464" end="470">gammaDistributionCompl</a><span class="params">(real <em>a</em>, real <em>b</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#gammaDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L464">#</a></dt>
<dd class="ddef">
<div class="summary">The &Gamma; distribution and its complement</div>
The &Gamma; distribution is defined as the integral from 0 to x of the
 gamma probability density function. The complementary function returns the
 integral from x to &infin;
<p class="bl"/>
 gammaDistribution = (<big>&#8747;<sub><small>0</small></sub><sup>x</sup></big> t<sup>b-1</sup>e<sup>-at</sup> dt) a<sup>b</sup>/&Gamma;(b)
<p class="bl"/>
 x must be greater than 0.</dd>
<dt class="decl">real <a class="symbol _function" name="betaDistribution" href="./htmlsrc/tango.math.Probability.html#L499" kind="function" beg="499" end="502">betaDistribution</a><span class="params">(real <em>a</em>, real <em>b</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#betaDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L499">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="betaDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L505" kind="function" beg="505" end="508">betaDistributionCompl</a><span class="params">(real <em>a</em>, real <em>b</em>, real <em>x</em>)</span>; <a title="Permalink to this symbol" href="#betaDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L505">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="betaDistributionInv" href="./htmlsrc/tango.math.Probability.html#L511" kind="function" beg="511" end="514">betaDistributionInv</a><span class="params">(real <em>a</em>, real <em>b</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#betaDistributionInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L511">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="betaDistributionComplInv" href="./htmlsrc/tango.math.Probability.html#L517" kind="function" beg="517" end="520">betaDistributionComplInv</a><span class="params">(real <em>a</em>, real <em>b</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#betaDistributionComplInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L517">#</a></dt>
<dd class="ddef">
<div class="summary">Beta distribution and its inverse</div>
Returns the incomplete beta integral of the arguments, evaluated
 from zero to x.  The function is defined as
<p class="bl"/>
 betaDistribution = &Gamma;(a+b)/(&Gamma;(a) &Gamma;(b)) *
 <big>&#8747;<sub><small>0</small></sub><sup>x</sup></big> t<sup>a-1</sup>(1-t)<sup>b-1</sup> dt
<p class="bl"/>
 The domain of definition is 0 &lt;= x &lt;= 1.  In this
 implementation a and b are restricted to positive values.
 The integral from x to 1 may be obtained by the symmetry
 relation
<p class="bl"/>
    betaDistributionCompl(a, b, x )  =  betaDistribution( b, a, 1-x )
<p class="bl"/>
 The integral is evaluated by a continued fraction expansion
 or, when b*x is small, by a power series.
<p class="bl"/>
 The inverse finds the value of x for which betaDistribution(a,b,x) - y = 0</dd>
<dt class="decl">real <a class="symbol _function" name="poissonDistribution" href="./htmlsrc/tango.math.Probability.html#L548" kind="function" beg="548" end="555">poissonDistribution</a><span class="params">(int <em>k</em>, real <em>m</em>)</span>; <a title="Permalink to this symbol" href="#poissonDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L548">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="poissonDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L558" kind="function" beg="558" end="565">poissonDistributionCompl</a><span class="params">(int <em>k</em>, real <em>m</em>)</span>; <a title="Permalink to this symbol" href="#poissonDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L558">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="poissonDistributionInv" href="./htmlsrc/tango.math.Probability.html#L568" kind="function" beg="568" end="575">poissonDistributionInv</a><span class="params">(int <em>k</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#poissonDistributionInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L568">#</a></dt>
<dd class="ddef">
<div class="summary">The Poisson distribution, its complement, and inverse</div>
k is the number of events. m is the mean.
 The Poisson distribution is defined as the sum of the first k terms of
 the Poisson density function.
 The complement returns the sum of the terms k+1 to &infin;.
<p class="bl"/>
 poissonDistribution = <big>&Sigma; <sup>k</sup><sub><small>j=0</small></sub></big> e<sup>-m</sup> m<sup>j</sup>/j!
<p class="bl"/>
 poissonDistributionCompl = <big>&Sigma; <sup>&infin;</sup><sub><small>j=k+1</small></sub></big> e<sup>-m</sup> m<sup>j</sup>/j!
<p class="bl"/>
 The terms are not summed directly; instead the incomplete
 gamma integral is employed, according to the relation
<p class="bl"/>
 y = poissonDistribution( k, m ) = gammaIncompleteCompl( k+1, m ).
<p class="bl"/>
 The arguments must both be positive.</dd>
<dt class="decl">real <a class="symbol _function" name="binomialDistribution" href="./htmlsrc/tango.math.Probability.html#L605" kind="function" beg="605" end="622">binomialDistribution</a><span class="params">(int <em>k</em>, int <em>n</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#binomialDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L605">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="binomialDistributionCompl" href="./htmlsrc/tango.math.Probability.html#L636" kind="function" beg="636" end="654">binomialDistributionCompl</a><span class="params">(int <em>k</em>, int <em>n</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#binomialDistributionCompl" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L636">#</a></dt>
<dd class="ddef">
<div class="summary">Binomial distribution and complemented binomial distribution</div>
The binomial distribution is defined as the sum of the terms 0 through k
 of the Binomial probability density.
 The complement returns the sum of the terms k+1 through n.
<p class="bl"/>
 binomialDistribution = <big>&Sigma; <sup>k</sup><sub><small>j=0</small></sub></big> <big>&#40;</big> <sup><small>n</small></sup><sub><small>j</small></sub> <big>&#41;</big> p<sup>j</sup> (1-p)<sup>n-j</sup>
<p class="bl"/>
 binomialDistributionCompl = <big>&Sigma; <sup>n</sup><sub><small>j=k+1</small></sub></big> <big>&#40;</big> <sup><small>n</small></sup><sub><small>j</small></sub> <big>&#41;</big> p<sup>j</sup> (1-p)<sup>n-j</sup>
<p class="bl"/>
 The terms are not summed directly; instead the incomplete
 beta integral is employed, according to the formula
<p class="bl"/>
 y = binomialDistribution( k, n, p ) = betaDistribution( n-k, k+1, 1-p ).
<p class="bl"/>
 The arguments must be positive, with p ranging from 0 to 1, and k&lt;=n.</dd>
<dt class="decl">real <a class="symbol _function" name="binomialDistributionInv" href="./htmlsrc/tango.math.Probability.html#L682" kind="function" beg="682" end="704">binomialDistributionInv</a><span class="params">(int <em>k</em>, int <em>n</em>, real <em>y</em>)</span>; <a title="Permalink to this symbol" href="#binomialDistributionInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L682">#</a></dt>
<dd class="ddef">
<div class="summary">Inverse binomial distribution</div>
Finds the event probability p such that the sum of the
 terms 0 through k of the Binomial probability density
 is equal to the given cumulative probability y.
<p class="bl"/>
 This is accomplished using the inverse beta integral
 function and the relation
<p class="bl"/>
 1 - p = betaDistributionInv( n-k, k+1, y ).
<p class="bl"/>
 The arguments must be positive, with 0 &lt;= y &lt;= 1, and k &lt;= n.</dd>
<dt class="decl">real <a class="symbol _function" name="negativeBinomialDistribution" href="./htmlsrc/tango.math.Probability.html#L743" kind="function" beg="743" end="751">negativeBinomialDistribution</a><span class="params">(int <em>k</em>, int <em>n</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#negativeBinomialDistribution" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L743">#</a></dt>
<dt class="decl">real <a class="symbol _function" name="negativeBinomialDistributionInv" href="./htmlsrc/tango.math.Probability.html#L754" kind="function" beg="754" end="761">negativeBinomialDistributionInv</a><span class="params">(int <em>k</em>, int <em>n</em>, real <em>p</em>)</span>; <a title="Permalink to this symbol" href="#negativeBinomialDistributionInv" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.math.Probability.html#L754">#</a></dt>
<dd class="ddef">
<div class="summary">Negative binomial distribution and its inverse</div>
Returns the sum of the terms 0 through k of the negative
 binomial distribution:
<p class="bl"/>
 <big>&Sigma; <sup>k</sup><sub><small>j=0</small></sub></big> <big>&#40;</big> <sup><small>n+j-1</small></sup><sub><small>j-1</small></sub> <big>&#41;</big> p<sup>n</sup> (1-p)<sup>j</sup>
<p class="bl"/>
 In a sequence of Bernoulli trials, this is the probability
 that k or fewer failures precede the n-th success.
<p class="bl"/>
 The arguments must be positive, with 0 &lt; p &lt; 1 and r&gt;0.
<p class="bl"/>
 The inverse finds the argument y such
 that negativeBinomialDistribution(k,n,y) is equal to p.
<p class="bl"/>
 The Geometric Distribution is a special case of the negative binomial
 distribution.
 <pre class="d_code">
<span class="i">geometricDistribution</span>(<span class="i">k</span>, <span class="i">p</span>) = <span class="i">negativeBinomialDistribution</span>(<span class="i">k</span>, <span class="n">1</span>, <span class="i">p</span>);
</pre>
<p class="sec_header">References:</p><a href="http://mathworld.wolfram.com/NegativeBinomialDistribution.html">http://mathworld.wolfram.com/NegativeBinomialDistribution.html</a></dd></dl>
</div>
<div id="footer">
  <p>Based on the CEPHES math library, which is
            Copyright (C) 1994 Stephen L. Moshier (moshier@world.std.com).</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:14 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>